package com.hspedu.newData.dmsxl.字符串;

import org.junit.Test;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-13 
 * @Version: 1.0
 */

public class LC3335字符串转换后的长度Ⅰ {

    public int lengthAfterTransformations(String s, int t) {

        int mod = 1000000007;
        int[] ans = new int[26];
        for (int i = 0; i < s.length(); i++) {
            ++ans[s.charAt(i) - 'a'];
        }

        for (int i = 0; i < t; i++) {

            int t1 = ans[25];

            int t2 = (ans[0] + ans[25]) % mod;
            for (int j = 25; j >= 2; j--) {
                ans[j] = ans[j-1];
            }
            ans[0] = t1;
            ans[1] = t2;
        }

        int count = 0;
        for (int i = 0; i < 26; i++) {
            count = (count + ans[i])%mod;
        }
        return count ;
    }

    @Test
    public void test() {
        // 测试代码

        lengthAfterTransformations("abcyy",2);
    }
}
